infra: add setup-llvm composite action#1894
Merged
Merged
Conversation
New composite action that installs LLVM/Clang to a pinned version on Linux and Windows runners and exposes the unversioned binaries on PATH. Intended to become the single source of truth for the LLVM major used across every prebuild / cpp-test / coverage / benchmark workflow in the monorepo: bumping `version` (Linux apt major) and `windows-version` (chocolatey full pin) defaults rolls the whole repo forward in one place. - Linux: install via apt.llvm.org `llvm.sh <version> all`, then prepend `/usr/lib/llvm-<version>/bin` to `$GITHUB_PATH` so unversioned `clang`, `clang++`, `clang-format`, `clang-tidy`, `git-clang-format`, `lld`, `llvm-cov`, `llvm-profdata`, ... resolve to the chosen major. - Windows: `choco upgrade llvm --version=<windows-version> -y --allow-downgrade` (defaults to a specific patch release to avoid silent drift when chocolatey ships a new one) and add `C:\Program Files\LLVM\bin` to `$GITHUB_PATH`. - macOS: no-op (Apple Clang is set up via setup-apple-clang). Defaults: version=22, windows-version=22.1.0.
gianni-cor
approved these changes
May 5, 2026
Contributor
Tier-based Approval Status |
jesusmb1995
approved these changes
May 5, 2026
Contributor
Author
|
/review |
This was referenced May 5, 2026
gianni-cor
added a commit
that referenced
this pull request
May 5, 2026
setup-build-host is pinned by SHA at every caller, so changes to its install path only take effect once each caller bumps its `@<sha>` pin. Land this first so the follow-up PR — which switches every C++ workflow to call the dedicated `setup-llvm` composite action (#1894) and bumps the setup-build-host pin in lockstep — can do both moves in one squash-merge without double-installing LLVM (19 here + 22 in setup-llvm) on every prebuild / cpp-lint job in the interim. Callers pinned to the old SHA are unaffected. Callers that bump to this SHA MUST invoke `setup-llvm` themselves on Linux and Windows runners; this action no longer provides a Clang toolchain. Co-authored-by: gianni-cor <gianfranco.cordella@tether.io>
tamer-hassan-tether
pushed a commit
that referenced
this pull request
May 5, 2026
New composite action that installs LLVM/Clang to a pinned version on Linux and Windows runners and exposes the unversioned binaries on PATH. Intended to become the single source of truth for the LLVM major used across every prebuild / cpp-test / coverage / benchmark workflow in the monorepo: bumping `version` (Linux apt major) and `windows-version` (chocolatey full pin) defaults rolls the whole repo forward in one place. - Linux: install via apt.llvm.org `llvm.sh <version> all`, then prepend `/usr/lib/llvm-<version>/bin` to `$GITHUB_PATH` so unversioned `clang`, `clang++`, `clang-format`, `clang-tidy`, `git-clang-format`, `lld`, `llvm-cov`, `llvm-profdata`, ... resolve to the chosen major. - Windows: `choco upgrade llvm --version=<windows-version> -y --allow-downgrade` (defaults to a specific patch release to avoid silent drift when chocolatey ships a new one) and add `C:\Program Files\LLVM\bin` to `$GITHUB_PATH`. - macOS: no-op (Apple Clang is set up via setup-apple-clang). Defaults: version=22, windows-version=22.1.0.
tamer-hassan-tether
pushed a commit
that referenced
this pull request
May 5, 2026
setup-build-host is pinned by SHA at every caller, so changes to its install path only take effect once each caller bumps its `@<sha>` pin. Land this first so the follow-up PR — which switches every C++ workflow to call the dedicated `setup-llvm` composite action (#1894) and bumps the setup-build-host pin in lockstep — can do both moves in one squash-merge without double-installing LLVM (19 here + 22 in setup-llvm) on every prebuild / cpp-lint job in the interim. Callers pinned to the old SHA are unaffected. Callers that bump to this SHA MUST invoke `setup-llvm` themselves on Linux and Windows runners; this action no longer provides a Clang toolchain. Co-authored-by: gianni-cor <gianfranco.cordella@tether.io>
Proletter
pushed a commit
that referenced
this pull request
May 24, 2026
New composite action that installs LLVM/Clang to a pinned version on Linux and Windows runners and exposes the unversioned binaries on PATH. Intended to become the single source of truth for the LLVM major used across every prebuild / cpp-test / coverage / benchmark workflow in the monorepo: bumping `version` (Linux apt major) and `windows-version` (chocolatey full pin) defaults rolls the whole repo forward in one place. - Linux: install via apt.llvm.org `llvm.sh <version> all`, then prepend `/usr/lib/llvm-<version>/bin` to `$GITHUB_PATH` so unversioned `clang`, `clang++`, `clang-format`, `clang-tidy`, `git-clang-format`, `lld`, `llvm-cov`, `llvm-profdata`, ... resolve to the chosen major. - Windows: `choco upgrade llvm --version=<windows-version> -y --allow-downgrade` (defaults to a specific patch release to avoid silent drift when chocolatey ships a new one) and add `C:\Program Files\LLVM\bin` to `$GITHUB_PATH`. - macOS: no-op (Apple Clang is set up via setup-apple-clang). Defaults: version=22, windows-version=22.1.0.
Proletter
pushed a commit
that referenced
this pull request
May 24, 2026
setup-build-host is pinned by SHA at every caller, so changes to its install path only take effect once each caller bumps its `@<sha>` pin. Land this first so the follow-up PR — which switches every C++ workflow to call the dedicated `setup-llvm` composite action (#1894) and bumps the setup-build-host pin in lockstep — can do both moves in one squash-merge without double-installing LLVM (19 here + 22 in setup-llvm) on every prebuild / cpp-lint job in the interim. Callers pinned to the old SHA are unaffected. Callers that bump to this SHA MUST invoke `setup-llvm` themselves on Linux and Windows runners; this action no longer provides a Clang toolchain. Co-authored-by: gianni-cor <gianfranco.cordella@tether.io>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎯 What problem does this PR solve?
sudo ./llvm.sh 19 all— sometimes mid-script — and Windows runners drift onchoco upgrade llvm -y(no version pin). Bumping the LLVM major or pinning a Windows fix means hand-editing ~15 workflows + 9 vcpkg toolchain files in lockstep.choco upgrade llvmsilently drift again the next time chocolatey ships a patch.📝 How does it solve it?
.github/actions/setup-llvm— a composite action that becomes the single point to bump the LLVM major across the whole repo. Two inputs:version(default22) — major used for the apt.llvm.org install on Linux.windows-version(default22.1.0) — exact chocolatey pin on Windows; explicit so a chocolatey patch release can't change CI behaviour without a code change.llvm.sh <version> allfrom apt.llvm.org, then prepends/usr/lib/llvm-<version>/binto$GITHUB_PATH. The apt packages already drop unversionedclang,clang++,clang-format,clang-tidy,git-clang-format,lld,llvm-cov,llvm-profdata, etc. under that directory, so a singlePATHprepend makes them resolve to the chosen major for the rest of the job — noupdate-alternativesneeded, and/usr/bin/clang-<N>keeps working for anything that still hard-codes a version.choco upgrade llvm --version=<windows-version> -y --allow-downgrade, then prependsC:\Program Files\LLVM\binto$GITHUB_PATH. Usesshell: powershell(Windows PowerShell 5.1) since the self-hostedwindows-11runners don't shippwsh.setup-apple-clang).🧪 How was it tested?
ubuntu-22.04,ubuntu-24.04) and Windows (windows-11); confirmedclang --versionresolves to LLVM 22.x on both,git-clang-format/clang-format/clang-tidyare on PATH unversioned, andbare-make generatepicks them up via the unversionedlinux-clang.cmaketoolchain.pwshdependency).